const express = require('express');
const router = express.Router();
const goodsModel = require('../model/good');

/* GET users listing. */
router.get('/', function (req, res, next) {
	//{}里面代表的是查询的参数，docs表示查询出来的文档
	goodsModel.find({}, function (err, docs) {
		if (err) {
			res.json({
				success: 'fail',
				data: null
			})
		} else {
			res.json({
				success: 'true',
				data: docs
			})
		}
	})
});

module.exports = router;